home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / nav4.doc < prev    next >
Text File  |  1995-03-31  |  22KB  |  355 lines

  1. Celestial Navigation ver 4.2 
  2. by Tom Metcalf 
  3. [This is an improved version of ALMANAC on Goodies Disk #2.  -jkh-] 
  4.  
  5. Following is version 4.2 of the HP-48SX program I wrote to do sight reductions 
  6. for celestial navigation.  It computes a position fix from observations of any 
  7. number of celestial bodies using a least squares fit to the altitude of the 
  8. bodies as a function of time.  The routine does all the standard corrections 
  9. for dip, refraction, parallax etc.  as well as correcting for motion of the 
  10. observer between sights. 
  11.  
  12. The major change from version 3 is a much improved user interface (including a 
  13. choice of input/output formats) and some route planning programs (great circle, 
  14. rhumb line, etc).  A bug which sometimes crashed the ADV program when the speed 
  15. from the INIT menu was set to zero has been corrected in version 4.2. 
  16.  
  17. It does not compute the GHA/declination of celestial bodies, so a copy of the 
  18. Nautical Almanac is required to use these routines.  It will, however, 
  19. interpolate the GHA and declination from the hourly entries on the daily pages 
  20. of the nautical almanac. 
  21.  
  22. A detailed description of the mathematical basis of the algorithm is available 
  23. upon request (send a surface mail address). 
  24.  
  25. Questions, comments, and suggestions are welcome 
  26.  
  27. Tom Metcalf 
  28. metcalf@uhifa.ifa.hawaii.edu 
  29.  
  30. ---------------------------------------------------------- 
  31.  
  32.  Instructions 
  33.  
  34. There are a number of programs included in the directory supplied, however, 
  35. there are even more variables etc used by the programs and these should not be 
  36. tampered with.  To avoid confusion, press the custom menu key (CST) on the 
  37. calculator and only the programs (without all of the variables) will be in the 
  38. menu. 
  39.  
  40.  
  41. Note: these instructions are not a "tutorial" on celestial navigation.  A basic 
  42. understanding of celestial navigation is assumed. 
  43.  
  44. There are several steps to go through to get a fix from a set of observations. 
  45.  
  46. 1.  First you need to set up several parameters used throughout the computation 
  47.     of the fix.  To do this, run the "INIT" program.  You should examine the 
  48.     displayed information and change anything which is incorrect.  Select the 
  49.     appropriate menu key to change the data: 
  50.  
  51.     Format: Selects HMS, HMT, or decimal format for angular input/output.  In 
  52.          HMS format angles are input in degrees-minutes-seconds format: 
  53.          dd.mmss.  In HMT format, angles are input/output in 
  54.          degrees-minutes-tenths format: dd.mmt.  For example 45 degrees 16 
  55.          minutes 12 seconds would be input/output as 45.1612 in HMS format and 
  56.          45.162 in HMT format.  Note that times are always input/output in HMS 
  57.          format regardless of the setting in the INIT menu.  For example, a 
  58.          time of 16:22:15 would always be input as 16.2215.  When you select 
  59.          HMT or HMS format, all angular input must be in the selected format 
  60.          throughout the sight reduction process. 
  61.     Index: The index correction which is to be *added* to the observed 
  62.          altitude, to be input in the current format (HMT or HMS).  For 
  63.          example, +1' should be input as 0.0100. 
  64.     Height: The height of the observer's eye for use in the dip correction. 
  65.          The default units are meters, however, any valid unit can be 
  66.          specified.  For example, to input a height of 10 feet, use 10_ft (use 
  67.          the orange-shift UNITS menu to avoid typing in the "ft").  Note that 
  68.          the "ft" must be in lower case.  If no units are specified, or if the 
  69.          units are invalid, meters are assumed. 
  70.     C/S: Course/Speed.  This specifies the course steered and speed of the 
  71.          vessel during the observations, used to correct for the motion of the 
  72.          vessel.  The course must be a true course in degrees (HMS or HMT 
  73.          format).  The default units for speed are knots, but any valid unit of 
  74.          velocity may be used.  Use the arrow keys and delete key to specify 
  75.          both course and speed before pressing "ENTER". 
  76.     P/T: Pressure/Temperature.  The atmospheric pressure and temperature used 
  77.          for the refraction correction: if you want to use standard conditions 
  78.          (usually good enough) simply hit ENTER without changing the displayed 
  79.          numbers.  The default units for pressure are millibars and the default 
  80.          units for temperature are celsius.  Any valid units can be specified, 
  81.          however.  Use the arrow keys and delete key to specify both pressure 
  82.          and temperature before pressing "ENTER". 
  83.     EXIT: Press EXIT when you're finished with the INIT menu. 
  84.  
  85. Remember: all times must be input in the "hms" format! 
  86.  
  87. 2.  If you want to start a new set of observations purge the variable "OBS". 
  88.     This variable stores all the observations, so, to start over, this variable 
  89.     must be removed.  You may want to rename it rather than remove it if it 
  90.     will be useful at a later time.  "OBS" is a matrix with each row 
  91.     representing one observation in the format: GHA DEC ALT.  It cannot be 
  92.     accessed from the custom menu but, if present, it should be the first 
  93.     variable in the VAR menu.  Use the MatrixWriter application in the 48SX to 
  94.     edit the "OBS" variable.  In particular, if you want to delete an 
  95.     observation, use the "-ROW" key in the MatrixWriter application. 
  96.  
  97. 3.  Run the program "SETUP".  This sets up the appropriate corrections and the 
  98.     GHA-declination interpolation for the observed body.  This program must be 
  99.     run whenever a new body is observed or whenever the observations have 
  100.     extended beyond the times given for the GHA/declination interpolation 
  101.     (TIM1,TIM2; see below) since the interpolation will become inaccurate.  If 
  102.     you are observing more than one body, input all the observations for each 
  103.     before proceeding to the next (temporal order does not matter).  The 
  104.     "SETUP" program asks for the following input: 
  105.   a) BODY: Select the appropriate body by pressing a menu key.  "planet" means 
  106.      any planet other than Venus or Mars (i.e.  Jupiter or Saturn).  edit the 
  107.      displayed number with the arrow and delete keys. 
  108.   b) SEMI-D: Semi-diameter in degrees, HMS or HMT format: e.g.  16.2 arc 
  109.      minutes should be input as 0.1612 in HMS format (since 0.2 min = 12") and 
  110.      0.162 in HMT format.  This is requested for the Sun only.  The default 
  111.      value is computed for the current date in the calculator.  If the 
  112.      observations are not for the date currently in the calculator, the SD may 
  113.      need to be edited before you press ENTER. 
  114.   c) HP: Parallax in degrees, HMS or HMT format.  Moon,Venus,Mars only.  For 
  115.      the Moon, HP is found on the daily pages of the Nautical Almanac.  For 
  116.      Venus/Mars, it is found in a short "parallax" table in the explanation 
  117.      section of the Nautical Almanac.  For the moon a typical value might be 
  118.      54.4 arc minutes which would be input as 0.5424 in HMS format and 0.544 in 
  119.      HMT format.  The correction is much smaller for the planets: a typical 
  120.      value might be 0.3 arc minutes which would be input as 0.0018 in HMS 
  121.      format (since 0.3 arc minutes is 18 arc seconds) and 0.003 in HMT format. 
  122.   d) LIMB: Select lower limb (LL), upper limb (UL), or disk center (CENT) from 
  123.      the menu keys.  (Sun/Moon only). 
  124.   e) If the body is a *star* the program will ask for GHA-ARIES and SHA, DEC 
  125.      for the star at time TIM (from the daily pages of the Nautical Almanac). 
  126.      These should be at the whole hour (TIM) before the start of the 
  127.      observations.  GHA,DEC,SHA inputs must be in HMS or HMT format and the 
  128.      time must be in HMS format.  All must be input on the appropriate line 
  129.      *before* pressing "ENTER".  To move to the next item, use the down-arrow 
  130.      key.  Since the stars move at a very regular rate, no interpolation is 
  131.      necessary.  Skip to (g). 
  132.   e') GHA1 DEC1 TIM1: The Greenwich Hour Angle and declination at time TIM1. 
  133.      The actual values for the observations will be interpolated linearly from 
  134.      this value and the next.  TIM1 should be the whole hour before the 
  135.      observation times.  All three numbers should be input on the appropriate 
  136.      line *before* pressing "ENTER".  To move to the next item, use the 
  137.      down-arrow key.  GHA and DEC must be in HMS or HMT format depending on the 
  138.      selection in the INIT program (step 1), and the time must be in HMS 
  139.      format. 
  140.   f) GHA2 DEC2 TIM2: The second set of values for the linear interpolation. 
  141.      TIM2 should be a whole hour after TIM1 and in HMS format (generally, TIM1 
  142.      and TIM2 will be consecutive hours, however, this need not be the case if 
  143.      you are willing to forego some accuracy).  All observations must be 
  144.      between TIM1 and TIM2.  If this is not the case, the observations should 
  145.      be input in several groups, running "SETUP" between groups.  If the GHA 
  146.      passes through zero between GHA1 and GHA2, 360 degrees should be added to 
  147.      GHA2.  Similarly, the time should not pass through zero: if TIM1 is 23, 
  148.      TIM2 should be 24 not 0.  As an error check, the program will ask you to 
  149.      reinput the data if the time and GHA do not increase. 
  150.   g) DR LAT LON: Dead reckoning latitude and longitude at the time of the 
  151.      observations (not necessarily the time of the fix) to use in the 
  152.      correction of the observations for course and speed (HMS or HMT format). 
  153.      Negative values indicate East longitude or South latitude.  The default 
  154.      values displayed are the last known DR position.  If these are correct, 
  155.      simply hit ENTER.  If they are incorrect, they can be edited with the 
  156.      arrow and delete keys.  These values need not be precise; use the best 
  157.      information you have. 
  158.   h) TIME OF FIX: The time to which the course and speed corrections are made 
  159.      (HMS format).  This will be the time at which the fix is valid and should 
  160.      be the same for all observations.  Remember: time should not pass through 
  161.      zero - add 24 hours if necessary. 
  162.  
  163. 4.  Enter the observations: 
  164.   a) Run the "ADDOB" program to add an observation to the "OBS" variable. 
  165.      Enter the time of the observation (HMS format) and then the *uncorrected* 
  166.      altitude.  Care should be taken with the time: Since it is used in the 
  167.      interpolation of the GHA and declination of the body, it must lie within 
  168.      the range of times specified in steps 2e' and 2f.  It should not pass 
  169.      though 00:00.  If the time is not within the range specified in the 
  170.      "SETUP" program for the interpolation, the program will terminate without 
  171.      adding the observation to the "OBS" variable.  "ADDOB" does all 
  172.      corrections (index, dip, refraction, parallax, semi-diameter, 
  173.      course/speed).  The course/speed correction adjusts the GHA and 
  174.      declination but not the altitude of the observation. 
  175.   b) Repeat until all observations are input. 
  176.   c) If accurate dead reckoning information is available, it can be included in 
  177.      the fix by running the "ADDDR" program which includes the DR position in 
  178.      the "OBS" variable.  Dead reckoning information is only required when just 
  179.      two observations are available; otherwise, it is optional.  The input 
  180.      should be in "hms" format.  Negative values indicate East longitude or 
  181.      South latitude.  If the vessel is moving, the dead reckoning position 
  182.      should be computed at the same time used in step 2(h) above. 
  183.  
  184. Important note: If observations of more than one body are input, "SETUP" must 
  185. be run before starting the input for each body.  Use the same time in step 2(h) 
  186. for all bodies, unless the LOP's are advanced appropriately (see step 8). 
  187.  
  188.  
  189. 5.  Get the fix by running the "SOLVE" program.  This program can be run at any 
  190.     time when there are at least 3 observations (including dead reckoning) in 
  191.     "OBS".  It does not affect "OBS", so more observations can be input after 
  192.     running "SOLVE".  If "root error" appears (theoretically impossible) or if 
  193.     the position estimate is far from your dead reckoning position, there may 
  194.     be an error in the input data and it should be reentered.  If the data is 
  195.     correct, but the error persists, the position fix should not be trusted; 
  196.     note that the plot of the LOPs (step 7) can be used to determine the 
  197.     validity of the fix.  Remember: the fix is, at best, only as good as the 
  198.     data you supply, and you should examine the results critically! 
  199.  
  200.     "SOLVE" can update the DR position to keep a running fix; after the fix is 
  201.     computed "SOLVE" will display the fix and ask if you want the DR position 
  202.     updated.  The "DR" program can also be used to update the DR position "by 
  203.     hand". 
  204.  
  205.     The output is the optimum latitude and longitude, both in the current 
  206.     format.  North latitude and west longitude are positive numbers, while 
  207.     south latitude and east longitude are negative numbers.  For example, 157 
  208.     deg 49 min 54 sec W, 21 deg 17 min 30 sec N would be output as 
  209.  
  210.     HMS:   LON:  157.4954      HMT:   LON: 157.499     Decimal:  LON: 157.8317 
  211.            LAT:   21.1730             LAT: 21.175                LAT: 21.2917 
  212.  
  213.  
  214. 6.  Since the SOLVE program uses a least squares fit to the altitude of one or 
  215.     more bodies, it is possible to get a fix from a relatively large number of 
  216.     observations of a single body over a relatively short period of time (say 
  217.     20 observations in 20 minutes).  If all observations are for a *single 
  218.     celestial body* (no DR) over a relatively short period of time, run the 
  219.     "ERROR" program to get an estimate of the position error (miles).  This 
  220.     program assumes an error on the observations of one arc minute, and should 
  221.     be multiplied by the actual sextant error in arc minutes if it is other 
  222.     than one. 
  223.  
  224. 7.  Run the "PLOTP" program to plot the lines of position.  To run this program 
  225.     the position fix from "SOLVE" must be left as the first two numbers on the 
  226.     stack (longitude in level 2, latitude in level 1; this defines the center 
  227.     of the plot).  The "PLOTP" program will ask you for the scale of the plot 
  228.     in miles.  The program makes the scale of the plot as close as possible to 
  229.     this size.  Hence, if you input 100 miles, the HP-48SX screen will display 
  230.     a region of the Earth's surface about 100 miles on a side (latitude on the 
  231.     vertical scale (North up), longitude on the horizontal scale (East right)). 
  232.     The default is 9 miles; if this is what you want, simply press "enter" at 
  233.     the prompt.  The program will work for very large scales (try 10000), but 
  234.     the Earth's spherical surface is mapped onto a flat lat/lon grid and hence 
  235.     the lines (really circles) of position will appear somewhat distorted.  The 
  236.     larger the scale the longer it takes to plot the LOP's.  A cross-hair is 
  237.     drawn at the position of the fix with line segments one mile long (from tip 
  238.     to tip).  The cross hair can be used to judge the scale of the plot but for 
  239.     large plots it will disappear as it becomes impossible to resolve a one 
  240.     mile line segment.  If no lines of position appear, you need to expand the 
  241.     plot by using a larger scale value.  Press "ATTN" when you are done with 
  242.     the plot.  Note that the "coordinate" graph utility and the arrow keys 
  243.     built into the calculator can be used to examine the lat/lon coordinates 
  244.     (always decimal format) of the plot after pressing <orange-shift GRAPH>. 
  245.  
  246. 8.  You can advance the LOP's contained in the "OBS" variable using the "ADV" 
  247.     program.  "ADV" assumes that the DR position is correct for the time 
  248.     implied by the "OBS" data: if it is not, the DR position should be updated 
  249.     with the "DR" program.  "ADV" asks for a distance in nautical miles and a 
  250.     true course describing the vessel's motion.  All data in the "OBS" 
  251.     variable, as well as the DR position, will be advanced along this track. 
  252.     After "ADV" is run, another group of data may be added to "OBS" to update 
  253.     the running fix.  Note that the new data must be input with a "time of fix" 
  254.     (step 2h) consistent with the *advanced* LOP's.  For example, if you 
  255.     advance the LOP's by the distance traveled in 6 hours, the time of fix in 
  256.     step 2(h) should reflect this by having 6 hours added to the value used 
  257.     previously (so that they all apply at the same time).  Advancing lines of 
  258.     position by large distances is not, in general, a good idea, since errors 
  259.     will be incurred as your dead reckoning position becomes less certain.  The 
  260.     "ADV" program assumes the observer is moving along a constant course; if 
  261.     the course varies, "ADV" must be run separately for each course steered. 
  262.     If no "OBS" variable is present, "ADV" will update only the DR position and 
  263.     hence is a useful tool for keeping track of your DR position, even when you 
  264.     are not keeping a running fix.  For completeness, "ADV" includes a slight 
  265.     correction for the ellipticity of the Earth. 
  266.  
  267.     If the effects of a current need to be included, run "ADV" once for the 
  268.     motion of the vessel through the water and once for the direction and 
  269.     distance the current has moved the vessel since the last DR position. 
  270.  
  271.     If you make a mistake entering the data for "ADV", you can undo the damage 
  272.     by running "ADV" again with the same course but the negative of the 
  273.     distance. 
  274.  
  275. Route Planning: 
  276.  
  277.   The program "SAIL" calculates the course and distance from one position to 
  278. another along a rhumb line or a great circle.  Note that no correction is made 
  279. for the ellipticity of the Earth in this program.  To use it run SAIL and input 
  280. the starting and ending lat/lon in HMS or HMT format.  The default starting 
  281. position is the DR position and the default ending position is the last known 
  282. ending position.  When asked for the type of course press the appropriate menu 
  283. key: 
  284.  
  285.   RHUMB:  Returns the rhumb line course and distance 
  286.   GC:     Returns the great circle distance and initial course.  Note that 
  287.           the course along a great circle varies and the *initial* course 
  288.           is given. 
  289.   WAY:    Computes waypoints along a great circle.  You are asked for a "scale" 
  290.           which defines the length of each computed rhumb line segment along 
  291.           the great circle.  Any valid units can be input: if no units are 
  292.           specified or if the units are invalid, nautical miles are assumed. 
  293.           The output is a list of waypoints.  Each waypoint is itself a list in 
  294.           the format {lat lon course} where "lat/lon" are the latitude and 
  295.           longitude of the waypoint (HMS or HMT format) and "course" is the 
  296.           rhumb line course to the next waypoint (HMS or HMT format).  The 
  297.           list of waypoints may be long and there are several ways to 
  298.           examine it: (1) Use the editor or (2) execute OBJ-> to break the list 
  299.           into individual waypoints or (3) use the WVIEW program.   Note that 
  300.           the WVIEW program is the best way to view the data, but I wasn't 
  301.           up to writing a data browser so I use Donnelly's DBR program 
  302.           contained in his "Programmer's Toolkit".  If you don't have the 
  303.           "Programmer's Toolkit" installed, you won't be able to use WVIEW. 
  304.           Also output is the total distance along the track and the additional 
  305.           distance traveled due to approximating the great circle by a sequence 
  306.           of rhumb lines (labeled ADDD). 
  307. VERT:     Computes one vertex of the great circle connecting the starting and 
  308.           ending points (point of highest latitude). 
  309. COMP:     Computes a composite route which follows a great circle to a 
  310.           maximum latitude and follows that parallel until another great 
  311.           circle can be followed to the destination.  The output is a list 
  312.           of waypoints as in the WAY program.  Total distance along the 
  313.           track is also output.  The program requests the limiting latitude 
  314.           and the scale which gives the distance between waypoints along the 
  315.           great circle routes.  If the great circle from the starting 
  316.           to the ending point never crosses the limiting latitude, 
  317.           the message "GC is OK" is displayed.  If the starting or ending 
  318.           points are beyond the limiting latitude, the message "No sol'n" 
  319.           is displayed. 
  320. EXIT:     Exit the SAIL program when all desired computations have been 
  321.           done. 
  322.  
  323.  
  324.  
  325. Helpful Hints: 
  326.  
  327.   o Remember that South latitude or declination and East longitude must be 
  328.     negative numbers. 
  329.  
  330.   o If you need to compute a number for input into one of the programs (eg the 
  331.     distance traveled in the ADV program) there are several ways to proceed: 
  332.       a) Input an algebraic object, e.g. '(2+1/60)*6'  (quotes required) 
  333.       b) Compute before running the program and leave the number on the 
  334.          stack.  When the number is required use ^STK from the edit menu 
  335.          to get the number off the stack (^STK displayed when the calculator 
  336.          prompts you for info). 
  337.  
  338.  
  339.  
  340. Disclaimer: 
  341.  
  342.  
  343. This software is provided "as is" and is subject to change without notice.  No 
  344. warranty of any kind is made with regard to this software, including, but not 
  345. limited to, the implied warranties of merchantability and fitness for a 
  346. particular purpose.  The author shall not be liable for any errors or for 
  347. direct, indirect, special, incidental or consequential damages in connection 
  348. with the furnishing, performance, or use of this software.  Use it at your own 
  349. risk. 
  350.  
  351. Copyright 1991 by Thomas R.  Metcalf.  Permission is granted to any individual 
  352. or institution to use, copy, or redistribute this software so long as it is not 
  353. sold for profit and provided that this copyright notice and the above 
  354. disclaimer are retained. 
  355.